#include <iostream>

#define N 100

using namespace std;


int main ( )
{
    char s[N],s1[N],f;
    int i=0,j,n,pos=-1,lab;
    
    cout<<"enter the char"<<endl;
    scanf("%s",s);
    
    while(s[i++]!='\0')  //calculate the length
    
    for(j=0;j<i;j++)
    {
        s1[j]=s[j];  //copy the s to s1
    }
    s1[j]='\0';

    


    cout<<"the length is"<<--i<<endl;
    puts(s);
    puts(s1);
    
    for(j=0;j<i;j++)
    {
        s[i+j]=s1[j];          //connect s1 to s; 
    }

    s[i+j]='\0';
      

    puts(s);

    n=i+j;
    cout<<"enter the char finded"<<endl;
    cin>>f;
    for(i=0;i<n;i++)
    {
        if(f==s[i])            //find the postion ;
        {
            pos=i;
            break;
         }
    }
    cout<<"the postion of"<<f<<"is  "<<++pos<<endl;

    for(i=0;i<n;i++)
    {
        if(s1[i]>s[i]) 
        {
            lab=1;
            break;
        }
        else  if(s1[i]<s[i])    //compare s1 with s;
        {
            lab=-1;
            break;
        }
        else lab=0;
        }

    cout<<lab<<endl;



    cin>>i;
    return 0;
}